import request from '@/utils/request';

// 分页查询
export function page(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/mp/alarm/page',
		method: 'post',
		data: data,
	});
}

// 修改
export function updateById(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/mp/alarm/updateById',
		method: 'put',
		data: data,
	});
}

// 通过告警id查询告警时间段
export function queryPeriodByAlarmId(alarmId: number): ApiPromise<ApiResponse> {
	return request({
		url: '/management/mp/alarm/queryPeriodByAlarmId/' + alarmId,
		method: 'get',
	});
}

// 通过告警id更新告警时间段
export function updatePeriodByAlarmId(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/mp/alarm/updatePeriodByAlarmId',
		method: 'put',
		data: data,
	});
}
